<template>
	<el-dialog title="可选的案卷列表" class="el-dialog" v-model="isShowDialog" fullscreen="true" align="center">
		<el-card>
			<el-table
				ref="multipleTable" border
				:data="tableData"
				:default-sort="{ prop: 'name', order: 'descending' }"
				:row-style="{ height: '0' }"
				:cell-style="{ padding: '0' }"
				size="medium"
				style="width: 100%"
			>
				<el-table-column align="center" type="selection" width="55" />
				<el-table-column align="center" label="序号" width="60">
					<template #default="scope">{{ scope.row.sn }}</template>
				</el-table-column>
				<el-table-column align="center" property="evidenceNo" sortable label="案卷编号" show-overflow-tooltip />
				<el-table-column align="center" property="casePerson" sortable label="案卷名称" show-overflow-tooltip />
				<el-table-column align="center" property="evidenceCome" sortable label="案卷来源" show-overflow-tooltip />
				<el-table-column align="center" property="caseOrg" sortable label="提取部位" show-overflow-tooltip />
				<el-table-column align="center" property="evidencePerson" sortable label="提取人/提取时间" show-overflow-tooltip />
				<el-table-column align="center" property="evidenceCome" sortable label="提取方法" show-overflow-tooltip />
				<el-table-column align="center" property="evidenceCome" sortable label="数量" show-overflow-tooltip />
				<el-table-column align="center" property="evidenceCome" sortable label="位置" show-overflow-tooltip /> </el-table
		></el-card>
		<template #footer>
			<span class="dialog-footer">
				<el-button @click="onCancel" size="small">取 消</el-button>
				<el-button type="primary" @click="onSubmit" size="small">确 定</el-button>
			</span>
		</template>
	</el-dialog>
</template>
<script lang="ts">
import { ref, toRefs, reactive } from 'vue';

export default {
	name: 'BorrowEvidenceList',
	props: {
		formInline: Object,
	},
	setup() {
		const state = reactive({
			isShowDialog: false,
			tableData: [
				{
					sn: '1',
					evidenceNo: 'W00000000000000000001',
					kyhNo: 'K00000000000000000001',
					caseName: '西郊杀人案',
					caseTime: '2021-10-01',
					casePerson: '刘备',
					caseOrg: 'XXX市公安局',
					evidenceCount: 5,
					evidenceCome: '现场勘验',
					evidencePerson: '刘冰/2021-10-01',
					loc: 'A01-01-01',
					status: '库中',
				},
				{
					sn: '2',
					evidenceNo: 'W00000000000000000001',
					kyhNo: 'K00000000000000000001',
					caseName: '西郊杀人案',
					caseTime: '2021-10-01',
					casePerson: '刘备',
					caseOrg: 'XXX市公安局',
					evidenceCount: 5,
					evidenceCome: '现场勘验',
					evidencePerson: '刘冰/2021-10-01',
					loc: 'A01-01-01',
					status: '出库',
				},
			],
		});

		// 打开弹窗
		const openDialog = () => {
			state.isShowDialog = true;
		};

		// 关闭弹窗
		const closeDialog = () => {
			state.isShowDialog = false;
		};
		// 取消
		const onCancel = () => {
			closeDialog();
		};

		const onSubmit = () => {
			closeDialog();
		};

		return {
			openDialog,
			closeDialog,
			onCancel,
			onSubmit,
			...toRefs(state),
		};
	},
};
</script>
